<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>

		<view class="">
			<button @click="login()">登陆</button>
			<button @click="logout()">注销</button>
			<button @click="test()">测试</button>
			<button @click="test1()">测试1</button>
		</view>
	</view>
</template>

<script>
	import * as odooApi from '@/api/odoo_api.js'
	import {
		warehouseTrayGroupModel,
		localTestModel
	} from '@/api/odoo_api.js'
	import {
		HandleOdooApiBase
	} from '@/utils/handle_odoo_api.js'

	// // 使用odoojs调用odoo接口
	// import api from '@/utils/odoorpc'

	export default {
		data() {
			return {
				title: 'Hello',
				custom_list: [],
				offset: 0,
				aaa: new HandleOdooApiBase(warehouseTrayGroupModel, 'list')
			}
		},
		onLoad() {

		},
		methods: {
			login() {
				odooApi.odooLogin('admin', '123')
			},
			logout() {
				odooApi.odooLogout()
			},
			test() {
				// odooApi.odooBaseApi().list()
				this.aaa.getList({
					limit: 20,
					offset: 0,
					domain: {}
				})
			
				// odooApi.odooBaseApi().retrieve(15)
			},
			test1() {
				odooApi.warehouseTrayGroupModel.list()
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
